// skunkworks.cpp : main project file.

#include "stdafx.h"
#include "Form1.h"

using namespace std;

using namespace skunkworks;

struct container {
    // Default constructor
    container() {}
    // Copy Constructor
    container(const container& rhs) :
    m_a(rhs.m_a), m_b(rhs.m_b), m_stuff(rhs.m_stuff) {
        m_a = m_a;
    }
    // Assignment Constructuro
    container& operator=(const container& rhs) {
        container tmp(rhs);
        std::swap(*this, tmp);
        return *this;
    }
    // Custom Constructor
    container(int a) 
    : m_a(a) {}

    int     m_a;
    float   m_b;
    string  m_stuff;
};

void printcontainer(container* c) {
    if(c != NULL) {
        cout << c->m_a << c->m_b << c->m_stuff;
    } else {
        cout << "Invalid Pointer";
    }
}

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
    container cont(2);
    container x = cont;
    container* contptr = &x;

    cont.m_a = 2;

    cont.m_stuff = "This is a test";
    (*contptr).m_stuff += "Middle Stuff";
    contptr->m_stuff += "More Stuff";

    printcontainer(contptr);
   
	return 0;
}
